Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-184

Negative arguments should take the priority over numerical options

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1
    • 1.3
    • None
    • None

    Description

      A negative argument can be mistaken for an option, for example with the options '1' and 'N' both having an argument, the following command line:

      -N -123

      will be interpreted as the option N with no argument, and the option 1 with 23 as argument. But the right interpretation is N=-123. The token -123 has been processed as a potential option first before being considered as the argument of the previous option.

      This is consistent with JOpt Simple.

      Attachments

        Activity

          People

            ebourg Emmanuel Bourg
            ebourg Emmanuel Bourg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: